-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for uploading signature #905
Conversation
Signed-off-by: harkiratsm <multaniharry714@gmail.com>
@harkiratsm is attempting to deploy a commit to the Documenso Team Team on Vercel. A member of the Team first needs to authorize it. |
Thank you for following the naming conventions for pull request titles! 💚🚀 |
Important Auto Review SkippedAuto reviews are limited to the following labels: coderabbit. Please add one of these labels to enable auto reviews. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Before I go down the rabbit hole of reviewing this completely I've noticed that we've made a database change for this. My assumption would have been that we would have the user upload an image and then apply it to the signature canvas (fit to canvas) and grayscale it as needed. This would mean it's no different from a drawn signature from a storage perspective and should be easier to manage. |
Signed-off-by: harkiratsm <multaniharry714@gmail.com>
Signed-off-by: harkiratsm <multaniharry714@gmail.com>
Signed-off-by: harkiratsm <multaniharry714@gmail.com>
Signed-off-by: harkiratsm <multaniharry714@gmail.com>
Signed-off-by: harkiratsm <multaniharry714@gmail.com>
Signed-off-by: harkiratsm <multaniharry714@gmail.com>
/ready-for-review @Mythie @adithyaakrishna @catalinpit |
Thanks @harkiratsm 🚀 |
const [localSignature, setLocalSignature] = useState<{ | ||
value: string | null; | ||
type: SignatureType | null; | ||
} | null>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isolating useState Type to respective type.ts file is recommended/
@@ -90,7 +100,8 @@ export const SignatureField = ({ field, recipient }: SignatureFieldProps) => { | |||
}); | |||
|
|||
if (source === 'local' && !providedSignature) { | |||
setProvidedSignature(localSignature); | |||
setProvidedSignature(localSignature?.value ?? ''); | |||
setProvidedSignatureType(localSignature?.type ?? 'DRAW'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use SignatureType.DRAW
instead of 'DRAW'?
onChange={(value: string | null, isUploaded: boolean) => { | ||
setLocalSignature({ | ||
value, | ||
type: isUploaded ? SignatureType.UPLOAD : SignatureType.DRAW, | ||
}); | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for complex onChange function, it's better them to define them as function and use them in JSX
onChange={(v: string | null, isUploaded: boolean) => | ||
handleSignatureChange(v, isUploaded) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simply write
onChange={handleSignatureChange}
@@ -65,6 +69,7 @@ export const SignUpForm = ({ className, initialEmail, isGoogleSSOEnabled }: Sign | |||
email: initialEmail ?? '', | |||
password: '', | |||
signature: '', | |||
signatureType: 'DRAW', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace ''DRAW' with SignatureType.DRAW
onChange={(v: string | null, isUploaded: boolean) => | ||
handleSignatureChange(v, isUploaded) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simply write
onChange={handleSignatureChange}
This PR has not seen activitiy for a while. It will be closed in 30 days unless further activity is detected. |
This PR has been closed because of inactivity. |
This PR #765
Implemented support for signature uploads, enabling users to upload their signatures and sign documents. Updated the User table to store the signature type, facilitating document signing based on the uploaded signature.
Screenshots -
Demo -
doci.mov